/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.sowrov.afrigis.tools.sqlite;

import java.util.ArrayList;

/**
 *
 * @author Sowrov
 */
public class TableColumn {
    String name;
    ArrayList<String>attributes;

    public TableColumn() {
        name = "";
        attributes = new ArrayList<String>();
    }

    public TableColumn(String name) {
        this.name = name;
        this.attributes = new ArrayList<String>();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * Add an attribute of the column
     * @param att example: "Primary key"
     */
    public void addAttribute(String att) {
        this.attributes.add(att);
    }

    @Override
    public String toString() {
        StringBuilder str = new StringBuilder(name);
        for(int i=0; i<this.attributes.size(); i++) {
            str.append(" ");
            str.append(this.attributes.get(i));
        }
        return str.toString();
    }

    public void removeAllAttribute() {
        this.attributes.clear();
    }
}
